<!--{template common/header}-->

<!--{if $_GET[op] == 'delete'}-->
    <h3 class="flb">
        <em>{lang delete_blog}</em>
        <!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_G[gp_handlekey]');return false;" class="flbc" title="{lang close}">{lang close}</a></span><!--{/if}-->
    </h3>
<form method="post" action="home.php?mod=spacecp&ac=blog&op=delete&blogid=$blogid">
    <input type="hidden" name="referer" value="{echo dreferer()}" />
    <input type="hidden" name="deletesubmit" value="true" />
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <div class="c">{lang sure_delete_blog}?</div>
    <p class="o pns">
        <button type="submit" name="btnsubmit" value="true" class="pn pnc"><strong>{lang determine}</strong></button>
    </p>
</form>
<!--{elseif $_GET[op] == 'stick'}-->
<h3 class="flb">
    <em><!--{if $stickflag}-->{lang stick_blog}<!--{else}-->{lang cancel_stick_blog}<!--{/if}--></em>
    <!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_G[gp_handlekey]');return false;" class="flbc" title="{lang close}">{lang close}</a></span><!--{/if}-->
</h3>
<form method="post" action="home.php?mod=spacecp&ac=blog&op=stick&blogid=$blogid">
    <input type="hidden" name="referer" value="{echo dreferer()}" />
    <input type="hidden" name="sticksubmit" value="true" />
    <input type="hidden" name="stickflag" value="$stickflag" />
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <div class="c"><!--{if $stickflag}-->{lang sure_stick_blog}<!--{else}-->{lang sure_cancel_stick_blog}<!--{/if}-->?</div>
    <p class="o pns">
        <button type="submit" name="btnsubmit" value="true" class="pn pnc"><strong>{lang determine}</strong></button>
    </p>
</form>

<!--{elseif $_GET[op] == 'addoption'}-->
    <h3 class="flb">
        <em>{lang create_category}</em>
        <!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="blogCancelAddOption('$_G[gp_oid]');hideWindow('$_G[gp_handlekey]');return false;" class="flbc" title="{lang close}">{lang close}</a></span><!--{/if}-->
    </h3>
	<div class="c">
		{lang name}:<input type="text" name="newsort" size="10" id="newsort" class="px" />
	</div>
	<p class="o pns">
		<button type="button" name="btnsubmit" value="true" class="pn pnc" onclick="if(blogAddOption('newsort', '$_G[gp_oid]'))hideWindow('$_G[gp_handlekey]');"><strong>{lang create}</strong></button>
	</p>
	<script type="text/javascript">
		$('newsort').focus();
	</script>

<!--{elseif $_GET[op] == 'edithot'}-->
<h3 class="flb">
    <em>{lang adjust_hot}</em>
    <!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_G[gp_handlekey]');return false;" class="flbc" title="{lang close}">{lang close}</a></span><!--{/if}-->
</h3>
<form method="post" action="home.php?mod=spacecp&ac=blog&op=edithot&blogid=$blogid">
    <input type="hidden" name="referer" value="{echo dreferer()}" />
    <input type="hidden" name="hotsubmit" value="true" />
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <div class="c">
        {lang new_hot}:<input type="text" name="hot" value="$blog[hot]" size="10" class="px" />
    </div>
    <p class="o pns">
        <button type="submit" name="btnsubmit" value="true" class="pn pnc"><strong>{lang determine}</strong></button>
    </p>
</form>
<!--{else}-->
    <div id="pt" class=" cl">
        <!--{subtemplate common/simplesearchform}-->
        <div class="z">
            <a href="./" class="nvhm woo-blog" title="{lang homepage}">$_G[setting][bbname]</a> <em>&rsaquo;</em>
            <a href="home.php">$_G[setting][navs][4][navname]</a> <em>&rsaquo;</em>
            <!--{if $space[self]}-->
                <a href="home.php?mod=space&do=blog">{lang blog}</a>
            <!--{else}-->
                <a href="home.php?mod=space&username=$space[username]">$space[username] {lang somebody_space}</a> <em>&rsaquo;</em>
                <a href="home.php?mod=space&username=$space[username]&do=blog&view=we">{lang blog}</a>
            <!--{/if}-->
            <em>&rsaquo;</em>
            <!--{if $blog[blogid]}-->
                <a href="home.php?mod=space&uid=$blog[uid]&do=blog&id=$blog[blogid]">$blog[subject]</a> <em>&rsaquo;</em> {lang edit_blog}
            <!--{else}-->
                {lang memcp_blog}
            <!--{/if}-->
        </div>
    </div>
    <!--<div id="ct" class="ct2_a wp cl woo-bg-st" style="background:none;">-->

<div id="ct" class="wp cl woo-bg-st" style="background:none;">
    <div class="mn z woomar">
        <div class="bm cl">
            <script type="text/javascript" src="{STATICURL}image/editor/editor_function.js?{VERHASH}"></script>
            <script type="text/javascript" src="{$_G[setting][jspath]}home_blog.js?{VERHASH}"></script>
            <form id="ttHtmlEditor" method="post" action="home.php?mod=spacecp&ac=blog&blogid=$blog[blogid]{if $_G[gp_modblogkey]}&modblogkey=$_G[gp_modblogkey]{/if}" enctype="multipart/form-data">
                <h1 class=" cl">
                    <span class="y xs1 xw0 mtn woo-back"><a href="javascript:history.go(-1);">{lang previous_page}</a></span>
                    <img class="vm" src="{STATICURL}image/feed/blog.gif" alt="blog" /> <!--{if $blog[blogid]}-->{lang edit_blog}<!--{else}-->Viết Blog<!--{/if}-->
                </h1>
                
                <!--{hook/spacecp_blog_top}-->
                <table cellspacing="0" cellpadding="0" class="tfm">
                    <tr>
                        <td>
                        <span class="z name-post" style="padding:5px; *padding:7px 5px 5px;">Tiêu đề bài viết</span>
                        <input type="text" id="subject" name="subject" value="$blog[subject]" size="60" {if $_get[op] != 'edit'}onblur="relatekw();"{/if} class="px bg_home" style="width: 50%; padding:5px; border:1px solid #f2f2f2;" /></td>
                    </tr>
                    <tr>
                        <td>
                        
                        <textarea class="pt" name="message" id="uchome-ttHtmlEditor" style="height:100%;width:100%;display:none;border:0">$blog[message]</textarea>
                        <iframe src='home.php?mod=editor&charset={CHARSET}&allowhtml=$allowhtml&doodle={if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}1{/if}' name="uchome-ifrHtmlEditor" id="uchome-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:100%; height:400px; border:1px solid #f2f2f2;position:relative;"></iframe>
                        </td>
                    </tr>
                </table>
                <!--{hook/spacecp_blog_middle}-->
                <table cellspacing="0" cellpadding="0" width="100%" class="tfm">                    
                    <!--{if $_G['setting']['blogcategorystat'] && $categoryselect}-->
                    <tr>
                        <th>{lang site_categories}</th>
                        <td>
                            $categoryselect
                            ({lang select_site_blog_categories})
                        </td>
                    </tr>
                    <!--{/if}-->
                    <tr>
                        <th>{lang personal_category}</th>
                        <td>
                            <select name="classid" id="classid" onchange="addSort(this)" >
                                <option value="0">------</option>
                                <!--{loop $classarr $value}-->
                                <!--{if $value['classid'] == $blog['classid']}-->
                                <option value="$value[classid]" selected>$value[classname]</option>
                                <!--{else}-->
                                <option value="$value[classid]">$value[classname]</option>
                                <!--{/if}-->
                                <!--{/loop}-->
                                <!--{if !$blog['uid'] || $blog['uid']==$_G['uid']}--><option value="addoption" style="color:red;">+{lang create_new_categories}</option><!--{/if}-->
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>{lang label}</th>
                        <td class="pns"><input type="text" class="px vm" size="40" id="tag" name="tag" value="$blog[tag]" /> <button type="button" name="clickbutton[]" onclick="relatekw();" class="pn vm"><em>{lang auto_keyword}</em></button></td>
                    </tr>
                <!--{if $blog['uid'] && $blog['uid']!=$_G['uid']}-->
                <!--{eval $selectgroupstyle='display:none';}-->
                </table>
                <table style="display:none;">
                <!--{/if}-->
                    <tr>
                        <th>{lang privacy_settings}</th>
                        <td>
                            <select name="friend" onchange="passwordShow(this.value);" class="ps">
                                <option value="0"$friendarr[0]>{lang friendname_0}</option>
                                <option value="1"$friendarr[1]>{lang friendname_1}</option>
                                <option value="2"$friendarr[2]>{lang friendname_2}</option>
                                <option value="3"$friendarr[3]>{lang friendname_3}</option>
                                <option value="4"$friendarr[4]>{lang friendname_4}</option>
                            </select>
                            <label><input type="checkbox" name="noreply" value="1" class="pc"{if $blog[noreply]} checked="checked"{/if}> {lang comments_not_allowed}</label>
                        </td>
                    </tr>
                    <tbody id="span_password" style="$passwordstyle">
                        <tr>
                            <th>{lang password}</th>
                            <td class="pns"><input type="text" name="password" value="$blog[password]" size="10" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" class="px" /></td>
                        </tr>
                    </tbody>
                <!--{if $blog['uid'] && $blog['uid']!=$_G['uid']}-->
                </table>
                <table cellspacing="0" cellpadding="0" width="100%" class="tfm">
                <!--{/if}-->
                    <tbody id="tb_selectgroup" style="$selectgroupstyle">
                        <tr>
                            <th>{lang specified_friends}</th>
                            <td>
                                <select name="selectgroup" onchange="getgroup(this.value);" class="ps">
                                    <option value="">{lang from_friends_group}</option>
                                    <!--{loop $groups $key $value}-->
                                    <option value="$key">$value</option>
                                    <!--{/loop}-->
                                </select>
                                <p class="d">{lang choices_following_friends_list}</p>
                            </td>
                        </tr>
                        <tr>
                            <th>&nbsp;</th>
                            <td>
                                <textarea name="target_names" id="target_names" rows="3" class="pt">$blog[target_names]</textarea>
                                <p class="d">{lang friend_name_space}</p>
                            </td>
                        </tr>
                    </tbody>
                    <!--{if checkperm('manageblog')}-->
                    <tr>
                        <th>{lang hot}</th>
                        <td>
                            <input type="text" class="px" name="hot" id="hot" value="$blog[hot]" size="5" />
                        </td>
                    </tr>
                    <!--{/if}-->
                    <tr>
                        <th>{lang feed_option}</th>
                        <td>
                            <label for="makefeed"><input type="checkbox" name="makefeed" id="makefeed" value="1" class="pc"{if ckprivacy('blog', 'feed')} checked="checked"{/if}>{lang make_feed} (<a href="home.php?mod=spacecp&ac=privacy&op=feed" target="_blank">{lang change_default_settings}</a>)</label>
                        </td>
                    </tr>
                    <!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
                    <!--{eval $sectpl = '<tr><th><sec></th><td class="pns"><sec><div class="d"><sec></div></td></tr>';}-->
                    <!--{subtemplate common/seccheck}-->
                    <!--{/if}-->
                </table>
                <input type="hidden" name="blogsubmit" value="true" />
                <input type="button" id="blogbutton" name="blogbutton" value="{lang submit_release}" onclick="validate(this);" style="display: none;" />
                <input type="hidden" name="formhash" value="{FORMHASH}" />
            </form>
            <script type="text/javascript">
                function validate(obj) {
                    <!--{if $_G['setting']['blogcategorystat'] && $_G['setting']['blogcategoryrequired']}-->
                    var catObj = $("catid");
                    if(catObj) {
                        if (catObj.value < 1) {
                            alert("{lang select_system_cat}");
                            catObj.focus();
                            return false;
                        }
                    }
                    <!--{/if}-->
                    var makefeed = $('makefeed');
                    if(makefeed) {
                        if(makefeed.checked == false) {
                            if(!confirm("{lang no_feed_notice}")) {
                                return false;
                            }
                        }
                    }

                    if($('seccode')) {
                        var code = $('seccode').value;
                        var x = new Ajax();
                        x.get('home.php?mod=spacecp&ac=common&op=seccode&inajax=1&code=' + code, function(s){
                            s = trim(s);
                            if(s.indexOf('succeed') == -1) {
                                alert(s);
                                $('seccode').focus();
                                return false;
                            } else {
                                uploadEdit(obj);
                                return true;
                            }
                        });
                    } else {
                        uploadEdit(obj);
                        return true;
                    }
                }
            </script>
            <!--{if !$_G[inajax] && (!$blog['uid'] || $blog['uid']==$_G['uid'])}-->
            <table cellspacing="0" cellpadding="0" width="100%" class="tfm">
                <tr>
                    <th>{lang pic}</th>
                    <td class="pns">
                        <button type="button" name="clickbutton[]" onclick="edit_album_show('pic')" class="pn"><em>{lang upload_pic}</em></button>
                        <button type="button" name="clickbutton[]" onclick="edit_album_show('album')" class="pn"><em>{lang insert_pic}</em></button>
                    </td>
                </tr>
            </table>
            <!--{/if}-->
            <table cellspacing="0" cellpadding="0" id="uchome-edit-pic" class="tfm" style="display:none;">
                <tr>
                    <th>&nbsp;</th>
                    <td>
                        <strong>{lang select_pic}</strong>
                        <table summary="Upload" cellspacing="0" cellpadding="0">
                            <tbody id="attachbodyhidden" style="display:none">
                                <tr>
                                    <td>
                                        <form method="post" id="upload" action="home.php?mod=spacecp&ac=upload" enctype="multipart/form-data" target="uploadframe">
                                            <input type="file" name="attach" />
                                            <span id="localfile"></span>
                                            <input type="hidden" name="uploadsubmit" id="uploadsubmit" value="true" />
                                            <input type="hidden" name="albumid" id="albumid" value="0" />
                                            <input type="hidden" name="formhash" value="{FORMHASH}" />
                                        </form>
                                    </td>
                                </tr>
                            </tbody>
                            <tbody id="attachbody"></tbody>
                        </table>
                        <strong>{lang storage_album}</strong>
                        <table cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <select name="albumid" id="uploadalbum" onchange="addSort(this)" class="ps">
                                        <option value="-1">{lang select_album}</option>
                                        <option value="-1">{lang default_album}</option>
                                        <!--{loop $albums $value}-->
                                        <option value="$value[albumid]">$value[albumname]</option>
                                        <!--{/loop}-->
                                        <option value="addoption" style="color:red;">+{lang create_new_album}</option>
                                    </select>
                                    <script type="text/javascript" src="{$_G[setting][jspath]}home_uploadpic.js?{VERHASH}"></script>
                                    <iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table cellspacing="0" cellpadding="0" class="tfm" id="uchome-edit-album" style="display:none;">
                <tr>
                    <th>&nbsp;</th>
                    <td>
                        {lang select_album}: <select name="view_albumid" onchange="picView(this.value)" class="ps">
                            <option value="none">{lang select_album}</option>
                            <option value="0">{lang default_album}</option>
                            <!--{loop $albums $value}-->
                            <option value="$value[albumid]">$value[albumname]</option>
                            <!--{/loop}-->
                        </select>
                        <p class="d">{lang click_pic_insert_content}</p>
                        <div id="albumpic_body"></div>
                    </td>
                </tr>
            </table>
            <!--{hook/spacecp_blog_bottom}-->
            <table cellspacing="0" cellpadding="0" class="tfm">
                <tr>
                    <th>&nbsp;</th>
                    <td><button type="button" id="issuance" onclick="document.getElementById('blogbutton').click();" class="pn pnc"><strong>{lang save_publish}</strong></button></td>
                </tr>
            </table>
        </div>
    </div>        
    <div class="appl y cl">
        <div class="box-banner-cl">
            <img src="{IMGDIR}/banner-cl.png" align="" />
        </div>
    </div>
</div>
    <script type="text/javascript">
    if($('subject')) {
        $('subject').focus();
    }
    </script>
<!--{/if}-->

<!--{template common/footer}-->